<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 引入vue.js -->
		<script src="./js/vue.js"></script>
		<style type="text/css">
			div {
				width: 300px;
				height: 100px;
				margin: 20px;
			}
			#d1 {
				background-color: aqua;
			}
			#d2 {
				background-color: antiquewhite;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<div id="d1" @click="showPosition('d1',$event)">d1</div>
			<div id="d2" @click="showPosition('d2',$event)">d2</div>
		</div>
		<script>
			var vm = new Vue({
				el:"#app",
				methods:{						
					showPosition(name,e){
						console.log(`调用了方法showPosition,区域是：${name} 位置 x=${e.offsetX}    y=${e.offsetY}    `);
					}
				}
			})
		</script>
	</body>
</html>
